var menu = {
  data:function(){
    return {
      "expand_list":[
        {"item_class":"create_pane","item_i_class":"create_icon","item_span_class":"create_text","title":"新建","command":"create"},
        {"item_class":"newest_note menu_item","item_i_class":"newest_note_icon","item_span_class":"newest_note_text note_text","title":"最新文档","command":"lastModified"},
        {"item_class":"catagroy menu_item","item_i_class":"catagroy_icon","item_span_class":"catagroy_note_text note_text","title":"我的文件夹","command":"catagory"},
        {"item_class":"share menu_item","item_i_class":"share_icon","item_span_class":"share_note_text note_text","title":"与我分享","command":"shareToMe"},
        {"item_class":"tag_note menu_item","item_i_class":"tag_icon","item_span_class":"tag_note_text note_text","title":"标签","command":"tag"},
        {"item_class":"trash_note menu_item","item_i_class":"trash_icon","item_span_class":"trash_note_text note_text","title":"回收站","command":"trash"}
      ],
      "collapse_list":[
        {"item_class":"collapse-create","item_i_class":"collapse-item-create","title":"新建","command":"create"},
        {"item_class":"collapse-item","item_i_class":"collapse-item-newest","title":"最新文档","command":"lastModified"},
        {"item_class":"collapse-item","item_i_class":"collapse-item-sharetome","title":"与我分享","command":"shareToMe"},
        {"item_class":"collapse-item","item_i_class":"collapse-item-catagory","title":"我的文件夹","command":"catagory"},
        {"item_class":"collapse-item","item_i_class":"collapse-item-trash","title":"回收站","command":"trash"}
      ]
    };
  },
  template:'<div><div class="expand-layout" id="expand-layout">'+
    '<div class="submenu">'+
      '<div v-for="li in expand_list" v-bind:class="li.item_class" v-on:click="doClick($event)" v-bind:command="li.command"> '+
          '<i v-bind:class="li.item_i_class"></i>'+
          '<span v-bind:class="li.item_span_class">{{li.title}}</span>'+
      '</div>'+
    '</div>'+
  '</div>'+

  '<div  class="collapse-layout" type="collapse" id="collapse_menu">'+
      '<div v-for="li in collapse_list" v-bind:class="li.item_class" v-bind:title="li.title" v-on:click="doClick($event)" v-bind:command="li.command">'+
        '<i v-bind:class="li.item_i_class"></i>'+
      '</div>'+
  '</div></div>',
  methods:{
    "doClick":function(event){
      var eventType = $(event.currentTarget).attr("command");
      switch (eventType) {
        case "create":
          this.$parent.showMenu(event);
          event.stopPropagation();
        break;
        case "lastModified":
          var lists =   [{isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"1"},
            {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"2"},
            {isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"3"},
            {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"4"}];
          this.$parent.$refs.my_data_list.$data.lists = lists;
          this.$parent.$refs.my_data_list.$data.isDeleted = false;
        break;
        case "catagory":
          var lists = [
            {isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"1"},
            {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"2"},
            {isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"3"},
            {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"4"},
            {isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"5"},
            {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"6"},
            {isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"7"},
            {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"8"},
            {isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"9"},
            {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"10"},
            {isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"11"},
            {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"12"},
            {isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"13"},
            {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"14"}
          ];
          this.$parent.$refs.my_data_list.$data.lists = lists;
          //this.$parent.$refs.my_data_list.$data.isDeleted = false;
          this.$parent.$refs.my_data_list.$set(this.$parent.$refs.my_data_list.$data,"isDeleted",false);
        break;
        case "shareToMe":
        break;
        case "tag":
        break;
        case "trash":
        var lists = [
          {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"8"},
          {isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"9"},
          {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"10"},
          {isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"11"},
          {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"12"},
          {isLeaf:false,text:"我的资源dsdasdfasdfadsfasdfsdfsd我的资源dsdasdfasdfadsfasdfsdfsdff",id:"13"},
          {isLeaf:true,text:"test",abstract:"asdfsdfasdfasf",isLeaf:true,id:"14"}
        ];
        this.$parent.$refs.my_data_list.$data.lists = lists;
        this.$parent.$refs.my_data_list.$set(this.$parent.$refs.my_data_list.$data,"isDeleted",true);
        this.$parent.$refs.my_data_list.$set(this.$parent.$refs.my_data_list.$data,"hasParent",true);
        break;

      }
      var jqEl = $(event.currentTarget);
      jqEl.siblings().removeClass("selected");
      jqEl.addClass("selected");
    }
  }
}
